<template>
  <div class="message-detail fixed-top">
    <!-- 引入公共头部 -->
    <NavBar title="消息详情" fixed back/>
    <div class="message">
      <div class="message-content">{{list.content}}</div>
      <div class="message-time">{{UTILS.formatDateTime(list.createTime)}}</div>
    </div>
  </div>
</template>
<script>
import NavBar from '../../components/common/NavBar.vue'
import messageDetailApi from '../../api/user'
export default {
  name: 'messageDetail',
  data () {
    return {
      list: {
        createTime: '',
        content: ''
      }
    }
  },
  components: {
    NavBar
  },
  created () {
    let messageId = this.$route.query.messageId
    this.queryOneMessage(messageId)
  },
  methods: {
    queryOneMessage: function (messageId) {
      let _this = this
      messageDetailApi.queryOneMessageById(messageId).then(function (res) {
        _this.list = res.data.re
      })
    }
  }
}
</script>
<style scoped>
  .message-detail {
    background: #fff;
  }
  .message {
    padding: 10px;
  }
  .message .message-content {
    text-indent: 26px;
    font-size: 14px;
  }
  .message .message-time {
    margin-top: 20px;
    text-align: right;
    font-size: 12px;
    color: #999;
  }
</style>
